<?php

use App\Models\Node;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddSetCloseToFundPeriods extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('fund_periods', function (Blueprint $table) {
            $table->tinyInteger('set_close')->default(-1)->comment('设置收盘价尾号,-1代表未设置')->after('close');
            $table->unsignedTinyInteger('node')->default(Node::HUO_BI)->comment('开奖节点');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('fund_periods', function (Blueprint $table) {
            $table->dropColumn('set_close');
            $table->dropColumn('node');
        });
    }
}
